package edu.ntu.im.p2ptrade.msg;

import net.jxta.endpoint.Message;
import net.jxta.endpoint.StringMessageElement;
import edu.ntu.im.p2ptrade.P2PTrade;
import edu.ntu.im.p2ptrade.entity.User;

public class HeartBeat implements PMessage {
	private User user;
	public HeartBeat(User user){
		this.user = user;
	}
	public Message getMessageToTransfer() {
		Message msg = new Message();
		msg.addMessageElement(P2PTrade.getInstance().getAppName(),
				new StringMessageElement(PEER,user.getName(), null));
		msg
		.addMessageElement(P2PTrade.getInstance().getAppName(),
				new StringMessageElement(TYPE, HeartBeat.class
						.getSimpleName(), null));
		return msg;
	}
	public String toLogMessage() {
		// TODO Auto-generated method stub
		return null;
	}

}
